#ifndef DATABASE_H
#define DATABASE_H

#if defined(__GNUC__)
#include <mysql/mysql.h>
//#include <boost/pool/pool.hpp>
#endif

#include "ado/stdafx.h"

#if defined(_MSC_VER)
#include<WinSock2.h>
#include<mysql.h>
#pragma comment(lib, "ws2_32.lib")
#endif

#include <iostream>
#include <map>
#include <cstdarg>
#include <stack>
#include "standard/DBConfig.h"
//#include "nstring.h"
#include "public.h"





class  ADOLIB1_API Database
{
public:
    std::map<unsigned long int, std::string> getAllColumn(std::string);
    std::map<unsigned long int, std::string> getColumnOfArr(std::string, std::map<std::string, std::string>);
    std::string getColumnOfStr(std::string, std::map<std::string, std::string>);
    int findColumn(std::string, std::string);
    Database *findByArray(const char *fmt, va_list vp);
    std::string getWhere();
    Database *insertparam(std::map<std::string, std::string>, std::string&);
    Database *setparam(std::map<std::string, std::string>, std::string&);
    std::string getSet();
    std::string getInsert();
    virtual ~Database();
       Database();
private:
    std::string m_wheres;
    std::string m_sets;
    std::string m_inserts;

protected:    
    std::string m_prefix;
    std::string m_dbname;
    std::string m_rootpath;
    tDataBase *m_db;
 
};


/**
 *public:
    static SearchWord *init();
    ~SearchWord();
private:
    SearchWord();
    static SearchWord *_init;
    class CGarbo {public: ~CGarbo(){if (SearchWord::_init) delete SearchWord::_init;}};
    static CGarbo Garbo; 
 */
#endif
